//显示当前时间（年月日时分秒）
const getTime = () => {
  let year = new Date().getFullYear();
  let month =
    new Date().getMonth() + 1 < 10
      ? "0" + (new Date().getMonth() + 1)
      : new Date().getMonth() + 1;
  let date =
    new Date().getDate() < 10
      ? "0" + new Date().getDate()
      : new Date().getDate();
  let hh =
    new Date().getHours() < 10
      ? "0" + new Date().getHours()
      : new Date().getHours();
  let mm =
    new Date().getMinutes() < 10
      ? "0" + new Date().getMinutes()
      : new Date().getMinutes();
  let ss =
    new Date().getSeconds() < 10
      ? "0" + new Date().getSeconds()
      : new Date().getSeconds();
  let newDate =
    year + "-" + month + "-" + date + " " + hh + ":" + mm + ":" + ss;
  return newDate;
};
export default getTime;
